﻿<?php
include_once('common/header.php');	
if($AppUI->id <= 0) {
	$this->_redirect(HOST_VFRIEND);
}
$strCookiePage	= 'PAGE_MEMBER_OCCUPATION';
$intPage		= $objRequest->getParam('page', 0);
if($intPage == 0 && isset($_COOKIE[$strCookiePage]) && (int)$_COOKIE[$strCookiePage] > 1) {
	$intPage 	= (int)$_COOKIE[$strCookiePage];
}
$intLimit		= MEMBER_SEARCH_LIMIT;
$intTotal		= 0;
$intOff			= ($intPage > 0) ? (($intPage-1) * $intLimit) : 0;
if($intOff > MAX_DISPLAY) {
	$intOff		= MAX_DISPLAY;
}
$objVfriendUser	= new Vfriend_User();
$objMember		= new Member();
$objUser		= $objVfriendUser->getFull($AppUI->id);
$arrResult		= $objMember->occupation($objUser, $intOff, $intLimit, $intTotal);
if ($intPage > 1) {
	Vfriend_Function::setCookie($strCookiePage, $intPage);	
}
if ($intPage == 0) {
	$intPage = 1;
}
$this->view->arrResult		= $arrResult;
$this->view->intTotal		= $intTotal;
$this->view->intOffset		= $intOff;
$this->view->intLimit		= $intLimit;
?>